<?php
/*************************************************************************************
   Copyright notice

   This script uses some code parts of the glossary module for phpwcms (c) Oliver Georgi
   (c) 2002-2009 Oliver Georgi (oliver@phpwcms.de) // All rights reserved.

   This script uses some code parts from bmcatalog module
   (c) 2010 Benjamin Matzmorr, www.etype.de

   (c) 2012 webrealisierung gmbh, www.webrealisierung.ch
   Catalogue Module V 1.0.0  -  Date: 2012-06-01

   The GNU General Public License can be found at http://www.gnu.org/copyleft/gpl.html
   A copy is found in the textfile GPL.txt and important notices to the license
   from the author is found in LICENSE.txt distributed with these scripts.

   This script is distributed in the hope that it will be useful, but WITHOUT ANY
   WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
   PARTICULAR PURPOSE.  See the GNU General Public License for more details.

   This copyright notice MUST APPEAR in all copies of the script!
*************************************************************************************/
// ----------------------------------------------------------------
// obligate check for phpwcms constants
if (!defined('PHPWCMS_ROOT')) {
   die("You Cannot Access This Script Directly, Have a Nice Day.");
}
// ----------------------------------------------------------------

// Catalogue module content part form fields
// it's typically implemented in a 2 column table

// current module vars are stored in $phpwcms['modules'][$content["module"]]
// var to modules path: $phpwcms['modules'][$content["module"]]['path']

$mod_ctg = array();

$BE['HEADER'][] ='<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<link href="'.$phpwcms["modules"][$content["module"]]["dir"].'template/backend/css/custom/jquery-ui-1.8.19.custom.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
';

$mod_ctg['temp_tags']['sql'] = "SELECT ctge_tags FROM " . DB_PREPEND . "phpwcms_mod_catalogue_entry WHERE ctge_tags > '' AND ctge_status!=9 GROUP BY ctge_tags ";
$mod_ctg['temp_tags']['data'] = _dbQuery($mod_ctg['temp_tags']['sql']);
$mod_ctg['temp_tags']['all'] = array();
if (count($mod_ctg['temp_tags']['data'])>0) {
  foreach ($mod_ctg['temp_tags']['data'] as $row) {
  $mod_ctg['temp_tags']['arr'] = explode("|", trim($row["ctge_tags"],"|") );
  $mod_ctg['temp_tags']['all'] = array_merge($mod_ctg['temp_tags']['all'], array_map('trim', $mod_ctg['temp_tags']['arr']));
  }
  $mod_ctg['all_tags'] = '"' . implode( '", "', array_unique($mod_ctg['temp_tags']['all'])) . '"';
}
unset($mod_ctg['temp_tags']);

$BE['HEADER'][] = '
<script type="text/javascript">
$(function() {

		var availableTags = [ '.$mod_ctg['all_tags'].' ];

    function split( val ) {
			return val.split( /,\s*/ );
		}
		function extractLast( term ) {
			return split( term ).pop();
		}

$( "#fld_ctg_filter1,#fld_ctg_filter2,#fld_ctg_filter3,#fld_ctg_filter4" )
			.bind( "keydown", function( event ) {
				if ( event.keyCode === $.ui.keyCode.TAB &&
						$( this ).data( "autocomplete" ).menu.active ) {
					event.preventDefault();
				}
			})
			.autocomplete({
				minLength: 0,
				source: function( request, response ) {
					response( $.ui.autocomplete.filter(
						availableTags, extractLast( request.term ) ) );
				},
				focus: function() {
					return false;
				},
				select: function( event, ui ) {
					var terms = split( this.value );
					terms.pop();
					terms.push( ui.item.value );
					terms.push( "" );
					this.value = terms.join( ", " );
					return false;
				}
			});

	});

function compare(strA, strB) {

  if((parseFloat(strA) == parseInt(strA)) && !isNaN(strA) && (parseFloat(strB) == parseInt(strB)) && !isNaN(strB)){
  return strA-strB;
  } else {

     var icmp = strA.toLowerCase().localeCompare(strB.toLowerCase());
     return icmp == 0
            ? (strA > strB
              ? 1
              : (
                strA < strB ? -1 : 0
                )
              )
            : icmp;

  }
}

function sortasc(elem,srtdir) {
  var terms=new Array();
  var strOfLines = $.trim( $("#"+elem).val() );
  strOfLines = strOfLines.replace(/,+$/, "");
  var arrayOfLines = strOfLines.split(",");
  $.each(arrayOfLines, function(index, value) {
    terms.push( $.trim(value) );
  });
  if(srtdir=="asc") {
    terms.sort( compare );
  }else {
    terms.reverse( compare );
  }
  terms.push( "" );
  $("#"+elem).val(terms.join( ", " ));
}
</script>
';

//presettings for all vars
$mod_ctg['ctg_default'] = array(
  'ctg_catalogs' => array(),
  'ctg_tmpl' => '',
  'ctg_css' => '',
  /*-- rss feed --*/
  'ctg_rss_active' => 0,
  'ctg_rss_title' => '',
  'ctg_rss_descr' => '',
  'ctg_rss_number' => '',
  /*-- filters --*/
  'ctg_fltr0_render' => 'ul',
  'ctg_fltr0_dflt' => 'default',
  'ctg_filter1' => '',
  'ctg_fltr1_render' => 'ul',
  'ctg_fltr1_dflt' => 'default',
  'ctg_filter2' => '',
  'ctg_fltr2_dflt' => 'default',
  'ctg_filter3' => '',
  'ctg_fltr3_dflt' => 'default',
  'ctg_filter4' => '',
  'ctg_fltr4_dflt' => 'default',
  'ctg_imgwidth' => '',
  'ctg_imgheight' => '',
  'ctg_imgcrop' => 0,
  'ctg_imgrand' => 0,
  'ctg_imgwidth_detail' => '',
  'ctg_imgheight_detail' => '',
  'ctg_imgcrop_detail' => 0,
  'ctg_imgzoom_detail' => 0,
  'ctg_imgrand_detail' => 0,
  'ctg_listhtml' => 0,
  'ctg_usegooglemaps' => '',
  'ctg_googlemapscenterzoom' => 14
);

$content['br_catalogue'] = isset($content['br_catalogue']) ? array_merge($mod_ctg['ctg_default'], $content['br_catalogue']) : $mod_ctg['ctg_default'];
if(empty($content['br_catalogue']['ctg_catalogs'])) {
	$content['br_catalogue']['ctg_catalogs'] = array();
}

$BE['BODY_CLOSE'][] = '<script language="javascript" type="text/javascript">document.getElementById("target_ctype").disabled = true;</script>';

?>

<!-- top spacer - seperate from title/subtitle section -->
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>

<!-- start custom fields here -->
<!-- start selection fields -->
<tr>
  <td align="right" valign="top" class="chatlist"><?php echo $BL['modules'][$content["module"]]['cp_catalogs'] ?>:&nbsp;</td>
  <td>
    <div><div style="float:left;width:300px;" id="catalogs"><?php
    //get all entries
    $mod_ctg['temp_catalog']['sql']  = "SELECT * FROM ".DB_PREPEND."phpwcms_mod_catalogue_catalog  WHERE ctgc_status != 9 ORDER BY ctgc_name";
		$mod_ctg['temp_catalog']['data'] = _dbQuery($mod_ctg['temp_catalog']['sql']);

    $k=0;
    $mod_ctg['temp_catalog']['list']  = '';
		  foreach($mod_ctg['temp_catalog']['data'] as $value) {
        $mod_ctg['temp_catalog']['list']  .= '	<option value="'.$value['ctgc_id'].'"';
        if (in_array($value['ctgc_id'], $content['br_catalogue']['ctg_catalogs'])) {
          $mod_ctg['temp_catalog']['list']  .= ' selected="selected"';
        }
				$mod_ctg['temp_catalog']['list'] .= '>'.htmlspecialchars($value['ctgc_name']);
        if ($value['ctgc_status']==0)  $mod_ctg['temp_catalog']['list'] .= ' ['.$BL['modules'][$content['module']]['disabled'].']';
        $mod_ctg['temp_catalog']['list'] .= '</option>'.LF;
			  $k++;
      }

    if($k>20) $k=20;
?>
		  <select name="ctg_catalogs[]" size="<?php echo $k; ?>" multiple class="f11 listrow" id="fld_catalogs" style="width:300px"><?php echo $mod_ctg['temp_catalog']['list']; ?></select>
    </div>
    <div style="float:left;padding:2px;">
		<a href="#cat_anchor2" onclick="document.getElementById('fld_catalogs').size=document.getElementById('fld_catalogs').size-2"><img src="img/button/minus_11x11.gif" border="0" alt="-" width="11" height="11"></a><a href="#cat_anchor2" onclick="document.getElementById('fld_catalogs').size=document.getElementById('fld_catalogs').size+2"><img src="img/button/add_11x11.gif" border="0" alt="+" width="11" height="11"></a>
		</div>
    <div style="float:left;padding:2px;width:150px;" class="chatlist">
	<?php echo $BL['modules'][$content["module"]]['entry_multi'] ?>
		</div>
    </div>
  </td>
</tr><?php

    unset($mod_ctg['temp_catalog']);
    
 ?><tr>
  <td>&nbsp;</td>
  <td class="chatlist">{FILTER_0} &nbsp;<select name="ctg_fltr0_render" id="fld_fltr0_render" class="f11">
<option value="ul"<?php is_selected('ul', $content['br_catalogue']['ctg_fltr0_render']); ?>>ul</option>
<option value="sel"<?php is_selected('sel', $content['br_catalogue']['ctg_fltr0_render']); ?>>drop down</option>
<option value="div"<?php is_selected('div', $content['br_catalogue']['ctg_fltr0_render']); ?>>div</option>
<option value="js"<?php is_selected('js', $content['br_catalogue']['ctg_fltr0_render']); ?>>div + slider</option>
</select>&nbsp;
<input type="text" name="ctg_fltr0_dflt" class="f11b" id="fld_fltr0_dflt" value="<?php echo $content['br_catalogue']['ctg_fltr0_dflt'] ?>" style="width: 100px;" size="15" maxlength="255" />
  </td>
</tr>
<!-- end selection field -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- retrieve templates -->
<tr>
	<td align="right" class="chatlist" valign="top"><?php echo $BL['modules'][$content["module"]]['ctg_tmpl'] ?>:&nbsp;</td>
	<td><select name="ctg_tmpl" id="fld_tmpl" class="f11"><?php

	echo LF.'<option value="">'.$BL['be_admin_tmpl_default'].'</option>'.LF;

// templates
$mod_ctg['temp_tmpl']['list'] = get_tmpl_files($phpwcms['modules'][$content["module"]]['path'].'template/cntpart','tmpl,html');
if(is_array($mod_ctg['temp_tmpl']['list']) && count($mod_ctg['temp_tmpl']['list'])) {
	foreach($mod_ctg['temp_tmpl']['list'] as $val) {
		$mod_ctg['temp_tmpl']['sel'] = '';
		if($val == $content['br_catalogue']['ctg_tmpl']) $mod_ctg['temp_tmpl']['sel']= ' selected="selected"';
		$val = html_specialchars($val);
		echo '<option value="'.$val.'"'.$mod_ctg['temp_tmpl']['sel'].'>'.$val."</option>".LF;
	}
}
unset($mod_ctg['temp_tmpl']);
?></select><br /><span class="chatlist">&nbsp;<?php echo $phpwcms['modules'][$content["module"]]['dir'].'template/cntpart'; ?></span>
  </td>
</tr>
<!-- end templates -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<!-- css -->
<tr>
	<td align="right" class="chatlist" valign="top"><?php echo $BL['modules'][$content["module"]]['ctg_tmpl_css'] ?>:&nbsp;</td>
	<td><select name="ctg_css" id="fld_css" class="f11"><?php

	echo LF.'<option value="">'.$BL['be_admin_tmpl_default'].'</option>'.LF;

// css
$mod_ctg['temp_css']['list'] = get_tmpl_files($phpwcms['modules'][$content["module"]]['path'].'template/css','css');
if(is_array($mod_ctg['temp_css']['list']) && count($mod_ctg['temp_css']['list'])) {
	foreach($mod_ctg['temp_css']['list'] as $val) {
		$mod_ctg['temp_css']['sel'] = '';
		if($val == $content['br_catalogue']['ctg_css']) $mod_ctg['temp_css']['sel']= ' selected="selected"';
		$val = html_specialchars($val);
		echo '<option value="'.$val.'"'.$mod_ctg['temp_css']['sel'].'>'.$val."</option>".LF;
	}
}
unset($mod_ctg['temp_css']);
?></select><br /><span class="chatlist">&nbsp;<?php echo $phpwcms['modules'][$content["module"]]['dir'].'template/css'; ?></span>
  </td>
</tr>
<!-- end css -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- filter -->
<tr>
	<td align="right" class="chatlist" valign="top"><?php echo $BL['modules'][$content["module"]]['ctg_filter'] ?>:&nbsp;</td>
	<td><table cellpadding="0" cellspacing="0" border="0" summary="" width="100%">
    <tr>
			<td class="chatlist">#1&nbsp;</td>
      <td colspan="2"><textarea name="ctg_filter1" class="f11" id="fld_ctg_filter1" style="width:98%;" cols="50" rows="3"><?php echo $content['br_catalogue']['ctg_filter1'] ?></textarea></td>
    </tr>
    <tr>
      <td></td>
      <td class="chatlist">{FILTER_1}&nbsp;
<select name="ctg_fltr1_render" id="fld_fltr1_render" class="f11">
<option value="ul"<?php is_selected('ul', $content['br_catalogue']['ctg_fltr1_render']); ?>>ul</option>
<option value="sel"<?php is_selected('sel', $content['br_catalogue']['ctg_fltr1_render']); ?>>drop down</option>
<option value="div"<?php is_selected('div', $content['br_catalogue']['ctg_fltr1_render']); ?>>div</option>
<option value="js"<?php is_selected('js', $content['br_catalogue']['ctg_fltr1_render']); ?>>div + slider</option>
</select>
<input type="text" name="ctg_fltr1_dflt" class="f11b" id="fld_fltr1_dflt" value="<?php echo $content['br_catalogue']['ctg_fltr1_dflt'] ?>" style="width: 100px;" size="15" maxlength="255" />
</td>
      <td class="chatlist" align="right">&nbsp;<span style="cursor:pointer;" onclick="sortasc('fld_ctg_filter1','asc');">ASC</span> | <span style="cursor:pointer;" onclick="sortasc('fld_ctg_filter1','desc');">DESC</span></td>
    </tr>
  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="15" /></td></tr>
    <tr>
			<td class="chatlist">#2&nbsp;</td>
      <td colspan="2"><textarea name="ctg_filter2" class="f11" id="fld_ctg_filter2" style="width:98%;" cols="50" rows="3"><?php echo $content['br_catalogue']['ctg_filter2'] ?></textarea></td>
    </tr>
    <tr>
      <td></td>
      <td class="chatlist">{FILTER_2} &nbsp;DROP DOWN &nbsp;
<input type="text" name="ctg_fltr2_dflt" class="f11b" id="fld_fltr2_dflt" value="<?php echo $content['br_catalogue']['ctg_fltr2_dflt'] ?>" style="width: 100px;" size="15" maxlength="255" />
      </td>
      <td class="chatlist" align="right">&nbsp;<span style="cursor:pointer;" onclick="sortasc('fld_ctg_filter2','asc');">ASC</span> | <span style="cursor:pointer;" onclick="sortasc('fld_ctg_filter2','desc');">DESC</span></td>
    </tr>
  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="15" /></td></tr>
    <tr>
			<td class="chatlist">#3&nbsp;</td>
      <td colspan="2"><textarea name="ctg_filter3" class="f11" id="fld_ctg_filter3" style="width:98%;" cols="50" rows="3"><?php echo $content['br_catalogue']['ctg_filter3'] ?></textarea></td>
    </tr>
    <tr>
      <td></td>
      <td class="chatlist">{FILTER_3} &nbsp;DROP DOWN &nbsp;
<input type="text" name="ctg_fltr3_dflt" class="f11b" id="fld_fltr3_dflt" value="<?php echo $content['br_catalogue']['ctg_fltr3_dflt'] ?>" style="width: 100px;" size="15" maxlength="255" />
      </td>
      <td class="chatlist" align="right">&nbsp;<span style="cursor:pointer;" onclick="sortasc('fld_ctg_filter3','asc');">ASC</span> | <span style="cursor:pointer;" onclick="sortasc('fld_ctg_filter3','desc');">DESC</span></td>
    </tr>
  <tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="15" /></td></tr>
    <tr>
			<td class="chatlist">#4&nbsp;</td>
      <td colspan="2"><textarea name="ctg_filter4" class="f11" id="fld_ctg_filter4" style="width:98%;" cols="50" rows="3"><?php echo $content['br_catalogue']['ctg_filter4'] ?></textarea></td>
    </tr>
    <tr>
      <td></td>
      <td class="chatlist">{FILTER_4} &nbsp;DROP DOWN &nbsp;
<input type="text" name="ctg_fltr4_dflt" class="f11b" id="fld_fltr4_dflt" value="<?php echo $content['br_catalogue']['ctg_fltr4_dflt'] ?>" style="width: 100px;" size="15" maxlength="255" />
      </td>
      <td class="chatlist" align="right">&nbsp;<span style="cursor:pointer;" onclick="sortasc('fld_ctg_filter4','asc');">ASC</span> | <span style="cursor:pointer;" onclick="sortasc('fld_ctg_filter4','desc');">DESC</span></td>
    </tr>
  </table></td>
</tr>
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<tr>
  <td align="right" class="chatlist" valign="top"><img src="<?php echo $phpwcms["modules"][$content["module"]]["dir"] ?>img/icon_info.gif" border="0" alt="Help" />&nbsp;</td>
  <td class="chatlist"><?php echo $BL['modules'][$content["module"]]['ctg_filter_info'] ?></td>
</tr>
<!-- end filter -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- images listing -->
<tr><td  class="chatlist" colspan="2"><? echo $BL['modules'][$content["module"]]['ctg_img_listing']; ?></td></tr>
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>

<tr>
  <td align="right" class="chatlist" valign="top" style="padding-top:5px;"><?php echo $BL['modules'][$content["module"]]['ctg_tabs_images']; ?>&nbsp;</td>
  <td valign="top" rowspan="2"><table border="0" cellpadding="0" cellspacing="0" summary="">
    <tr>
      <td colspan="4">&nbsp;</td>
      <td><input type="checkbox" name="ctg_imgrand" id="ctg_imgrand" value="1" <?php is_checked(1, $content['br_catalogue']['ctg_imgrand']); ?> /></td>
      <td class="v10"><label for="ctg_imgrand" class="chatlist checkbox"><?php echo $BL['modules'][$content["module"]]['ctg_imgrand_listing'] ?></label></td>
    </tr>
    <tr>
      <td><input type="text" name="ctg_imgwidth" id="ctg_imgwidth" value="<?php echo $content['br_catalogue']['ctg_imgwidth']; ?>" style="width: 50px;" class="f11b" size="4" maxlength="4" onblur="if(!parseInt(this.value*1)) this.value='';" /></td>
      <td class="chatlist">&nbsp;&nbsp;<?php echo $BL['be_cnt_maxh'] ?>:&nbsp;</td>
      <td><input type="text" name="ctg_imgheight" id="ctg_imgheight" value="<?php echo $content['br_catalogue']['ctg_imgheight']; ?>" style="width: 50px;" class="f11b" size="4" maxlength="4" onblur="if(!parseInt(this.value*1)) this.value='';" /></td>
      <td class="chatlist">&nbsp;px&nbsp;&nbsp;&nbsp;</td>
      <td><input type="checkbox" name="ctg_imgcrop" id="ctg_imgcrop" value="1" <?php is_checked(1, $content['br_catalogue']['ctg_imgcrop']); ?> /></td>
      <td class="v10"><label for="ctg_imgcrop" class="chatlist checkbox"><?php echo $BL['be_image_crop'] ?></label></td>
    </tr>
  </table>
  </td>
</tr>
<tr>
  <td align="right" class="chatlist" valign="top" style="padding-top:5px;"><?php echo $BL['be_cnt_maxw']; ?>:&nbsp;</td>
</tr>
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<tr>
	<td align="right" class="chatlist"><?php echo $BL['modules'][$content["module"]]['usegooglemaps'] ?>&nbsp;</td>
	<td><table cellpadding="0" cellspacing="0" border="0" summary="">
		<tr>
			<td>
			<input name="ctg_usegooglemaps" type="checkbox" id="ctg_usegooglemaps" value="1" <?php is_checked(1, $content['br_catalogue']['ctg_usegooglemaps']); ?> />
			</td>
			<td><label for="ctg_usegooglemaps" class="chatlist checkbox"><?php echo $BL['modules'][$content["module"]]['ctg_act'] ?>&nbsp;</label></td>
		</tr>
	</table></td>
</tr>
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<tr>
	<td align="right" class="chatlist"><?php echo $BL['modules'][$content["module"]]['ctg_listhtml'] ?>&nbsp;</td>
	<td><table cellpadding="0" cellspacing="0" border="0" summary="">
		<tr>
			<td>
			<input name="ctg_listhtml" type="checkbox" id="ctg_listhtml" value="1" <?php is_checked(1, $content['br_catalogue']['ctg_listhtml']); ?> />
			</td>
			<td><label for="ctg_listhtml" class="chatlist checkbox"><?php echo $BL['modules'][$content["module"]]['ctg_listhtml2'] ?>&nbsp;</label></td>
		</tr>
	</table></td>
</tr>
<!-- end images listing -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- images detailview -->
<tr><td  class="chatlist" colspan="2"><? echo $BL['modules'][$content["module"]]['ctg_img_detail']; ?></td></tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>

<tr>
  <td align="right" class="chatlist" valign="top" style="padding-top:5px;"><?php echo $BL['modules'][$content["module"]]['ctg_tabs_images']; ?>&nbsp;</td>
  <td valign="top" rowspan="2"><table border="0" cellpadding="0" cellspacing="0" summary="">
    <tr>
      <td colspan="4"></td>
      <td><input type="checkbox" name="ctg_imgrand_detail" id="fld_imgrand_detail" value="1" <?php is_checked(1, $content['br_catalogue']['ctg_imgrand_detail']); ?> /></td>
      <td class="v10"><label for="fld_imgrand_detail" class="chatlist checkbox"><?php echo $BL['modules'][$content["module"]]['ctg_imgrand_detail'] ?></label></td>
    </tr>
    <tr>
      <td colspan="4"></td>
      <td><input type="checkbox" name="ctg_imgzoom_detail" id="fld_imgzoom_detail" value="1" <?php is_checked(1, $content['br_catalogue']['ctg_imgzoom_detail']); ?> /></td>
      <td class="v10"><label for="fld_imgzoom_detail" class="chatlist checkbox"><?php echo $BL['modules'][$content["module"]]['ctg_imgzoom_detail'] ?></label></td>
    </tr>
    <tr>
      <td><input type="text" name="ctg_imgwidth_detail" id="fld_imgwidth_detail" value="<?php echo $content['br_catalogue']['ctg_imgwidth_detail']; ?>" style="width: 50px;" class="f11b" size="4" maxlength="4" onblur="if(!parseInt(this.value*1)) this.value='';" /></td>
      <td class="chatlist">&nbsp;&nbsp;<?php echo $BL['be_cnt_maxh'] ?>:&nbsp;</td>
      <td><input type="text" name="ctg_imgheight_detail" id="fld_imgheight_detail" value="<?php echo $content['br_catalogue']['ctg_imgheight_detail']; ?>" style="width: 50px;" class="f11b" size="4" maxlength="4" onblur="if(!parseInt(this.value*1)) this.value='';" /></td>
      <td class="chatlist">&nbsp;px&nbsp;&nbsp;&nbsp;</td>
      <td><input type="checkbox" name="ctg_imgcrop_detail" id="fld_imgcrop_detail" value="1" <?php is_checked(1, $content['br_catalogue']['ctg_imgcrop_detail']); ?> /></td>
      <td class="v10"><label for="fld_imgcrop_detail" class="chatlist checkbox"><?php echo $BL['be_image_crop'] ?></label></td>
    </tr>
  </table></td>
</tr>
<tr>
  <td align="right" class="chatlist" valign="bottom" style="padding-bottom:3px;"><?php echo $BL['be_cnt_maxw']; ?>:&nbsp;</td>
</tr>
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="8" /></td></tr>
<tr>
	<td align="right" class="chatlist"><?php echo $BL['modules'][$content["module"]]['usegooglemaps'] ?>&nbsp;</td>
	<td><table cellpadding="0" cellspacing="0" border="0" summary="">
		<tr>
			<td><input type="text" name="ctg_googlemapscenterzoom" id="gkey" value="<?php echo $content['br_catalogue']['ctg_googlemapscenterzoom'] ?>" class="f11b" style="width: 50px;" size="4" maxlength="2" onblur="if(!parseInt(this.value*1)) this.value='';" /></td>
			<td class="chatlist">&nbsp;<?php echo $BL['modules'][$content["module"]]['googlemapscenterzoom'] ?>:</td>
		</tr>
	</table></td>
</tr>

<!-- end images detailview -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<tr><td colspan="2" class="rowspacer0x7"><img src="img/leer.gif" alt="" width="1" height="1" /></td></tr>
<!-- start rss -->
<tr>
  <td align="right" valign="top" class="chatlist" style="padding-top:3px;"><?php echo $BL['modules'][$content["module"]]['ctg_rss_feed'] ?>:&nbsp;</td>
	<td><table border="0" cellpadding="0" cellspacing="0" summary="">
  	 <tr>
      <td align="right" class="chatlist">&nbsp;</td>
      <td><input type="checkbox" style="vertical-align:middle;" name="ctg_rss_active" value="1" id="R92_1" <?php is_checked($content['br_catalogue']['ctg_rss_active'], 1) ?> />
      <label for="R92_1" class="chatlist"><?php echo $BL['modules'][$content["module"]]['ctg_rss_activate'] ?></label></td>
    </tr>
  	 <tr>
      <td align="right" class="chatlist">&nbsp;</td>
      <td class="chatlist"><?php
if (file_exists(PHPWCMS_ROOT.'/'.CONTENT_PATH.'rss/feed-catalog-'.$content['aid'].'-'.$content['id'].'.xml')) {

echo '(/'.CONTENT_PATH.'rss/feed-catalog-'.$content['aid'].'-'.$content['id'].'.xml)&nbsp;<a href="phpwcms.php?do=modules&module=br_catalogue&controller=module">'.$BL['modules'][$content["module"]]['ctg_rss_todelete'].'</a>';
} else {

echo $BL['modules'][$content["module"]]['ctg_rss_fileex'];
}
 ?>
</td>
    </tr>
    <tr><td colspan="2" class=""><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
  	 <tr>
      <td align="right" class="chatlist"><?php echo $BL['modules'][$content["module"]]['ctg_rss_title'] ?>:&nbsp;</td>
      <td><input type="text" maxlength="255" name="ctg_rss_title" value="<?php echo $content['br_catalogue']['ctg_rss_title']; ?>" class="f11b" style="width:300px;" />
          </td>
    </tr>
    <tr><td colspan="2" class=""><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
  	 <tr>
      <td align="right" class="chatlist" valign="top"><?php echo $BL['modules'][$content["module"]]['ctg_rss_descr'] ?>:&nbsp;</td>
      <td><textarea rows="4" name="ctg_rss_descr" cols="30" class='msgtext' id='ctg_rss_descr' style='width:300px'><?php echo $content['br_catalogue']['ctg_rss_descr']; ?></textarea></td>
    </tr>
    <tr><td colspan="2" class=""><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
    <tr>
      <td align="right" class="chatlist">&nbsp;</td>
      <td><input type="text" maxlength="3" name="ctg_rss_number" value="<?php echo $content['br_catalogue']['ctg_rss_number']; ?>" class="f11b" style="width:50px;" /><span class="chatlist">&nbsp;<?php echo $BL['modules'][$content["module"]]['ctg_rss_number'] ?></span></td>
    </tr>
    <tr><td colspan="2" class=""><img src="img/leer.gif" alt="" width="1" height="5" /></td></tr>
    </table>

  </td>
</tr>
<!-- end rss -->
<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>
<!-- end custom fields -->
<!-- bottom spacer - is followed by status "visible" checkbox -->
<tr><td colspan="2" style="padding-top:8px"><img src="img/lines/l538_70.gif" alt="" width="538" height="1" /></td></tr>
<?php
unset($mod_ctg);
?>